/******************************************************************************
 * * dummy_ui_common.c - test of ui common functions
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
/*********************
*      INCLUDES
*********************/
#include <stdlib.h>
#include <stdio.h>
#include "inter_common_ui_interface.h"
#include "inter_modemadp_interface.h"
#include "../../../lvgl/hal/hal.h"

/**********************
*  FUNCTION PROTOTYPES
**********************/
static VOID UI_Status_Bar_Create_Test(lv_obj_t * Obj, lv_event_t Event);
static VOID  UI_Normal_List_Only_Create_Test(lv_obj_t * Obj, lv_event_t Event);

extern VOID UI_Normal_Destroy_LastWin(VOID);

/**********************
*  STATIC VARIABLES
**********************/
static UINT32           last_key;
static lv_indev_state_t last_key_state = LV_INDEV_STATE_REL;
static INT8             ListIndex      = 0;
static lv_obj_t         *ScrCont       = NULL;
static lv_obj_t         *PhoneBg       = NULL;
// static BOOL             LIST_MENU      = TRUE;

/**********************
*      MACROS
**********************/
#define UI_COMMON_TEST_LIST_CNT    30

LV_IMG_DECLARE(phonebg);

/**********************
*   STATIC FUNCTIONS
**********************/
static UINT8 UI_Normal_Test_KeyFunc(lv_obj_t *obj, UI_KEY_STATUS key_sta, UI_KEY_VALUE key_val)
{
    if (key_sta == KEY_RELEASED)
    {
        switch (key_val)
        {
        case KEY_OK:
            // UI_Normal_Destroy();
            break;

        case KEY_SOFTRIGHT:
        {
            UI_Normal_Destroy_LastWin();
            // UI_Normal_Destroy();
            UI_Status_Bar_Create_Test(NULL, LV_EVENT_CLICKED);
            UI_Normal_List_Only_Create_Test(NULL, LV_EVENT_CLICKED);
            // LIST_MENU = TRUE;
            return(1);
        }

        case KEY_UP:
            ListIndex--;
            if (ListIndex < 0)
            {
                ListIndex = UI_COMMON_TEST_LIST_CNT - 1;
            }

            break;

        case KEY_DOWN:

            ListIndex++;
            if (ListIndex == UI_COMMON_TEST_LIST_CNT)
            {
                ListIndex = 0;
            }

            break;

        case KEY_LEFT:
        case KEY_RIGHT:
            // return 1;
            break;

        default:
            break;
        } /* switch */
    }
    return(0);
} /* UI_Normal_Test_KeyFunc */


static UINT8 UI_Normal_TaTest_KeyFunc(lv_obj_t *obj, UI_KEY_STATUS key_sta, UI_KEY_VALUE key_val)
{
    if (key_sta == KEY_RELEASED)
    {
        switch (key_val)
        {
        case KEY_OK:
            // UI_Normal_Destroy();

            break;

        case KEY_SOFTRIGHT:
        {
            const INT8 *txt = lv_textarea_get_text(obj);
            UINT16     len  = strlen(txt);
            if (len > 0)
            {
                break;
            }
            else
            {
                UI_Normal_Destroy_LastWin();
                UI_Status_Bar_Create_Test(NULL, LV_EVENT_CLICKED);
                UI_Normal_List_Only_Create_Test(NULL, LV_EVENT_CLICKED);
                // LIST_MENU = TRUE;
                return(1);
            }
        }

        default:
            break;
        } /* switch */
    }
    return(0);
} /* UI_Normal_Test_KeyFunc */


static VOID UI_Normal_Btn_Release_Func(lv_obj_t *btn, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }

    printf("Btn_Release_Func\n");
}


static VOID UI_Normal_Label_Only_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Label_Only_Desc_t NormalLblOnlyDesc;

    memset(&NormalLblOnlyDesc, 0, sizeof(UI_Normal_Label_Only_Desc_t));

    NormalLblOnlyDesc.TitleBar.TxtId    = PHONE_TEXT_ID_ALARM;
    NormalLblOnlyDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    NormalLblOnlyDesc.ContLabel.TxtId    = PHONE_TEXT_ID_DEL_NUM_FROM_LIST_Q;
    NormalLblOnlyDesc.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;

    NormalLblOnlyDesc.ButtonBar.ButtonL.Valid = FALSE;
    NormalLblOnlyDesc.ButtonBar.ButtonM.Valid = FALSE;
    NormalLblOnlyDesc.ButtonBar.ButtonR.Valid = TRUE;

    NormalLblOnlyDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;

    NormalLblOnlyDesc.KeyFunc = UI_Normal_Test_KeyFunc;

    UI_Normal_Label_Only_Create(&NormalLblOnlyDesc);
}


static VOID UI_Normal_Ta_Only_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Ta_Only_Desc_t TaDesc;

    memset(&TaDesc, 0, sizeof(UI_Normal_Ta_Only_Desc_t));

    TaDesc.TitleBar.TxtId    = PHONE_TEXT_ID_NAME;
    TaDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_LEFT;

    TaDesc.ContTa.TaTxt        = "Ta Only Test....";
    TaDesc.ContTa.TaCursorHide = FALSE;

    TaDesc.ButtonBar.ButtonL.Valid = FALSE;
    TaDesc.ButtonBar.ButtonM.Valid = TRUE;
    TaDesc.ButtonBar.ButtonR.Valid = TRUE;
    TaDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    TaDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    TaDesc.KeyFunc                 = UI_Normal_TaTest_KeyFunc;

    UI_Normal_Ta_Only_Create(&TaDesc);
}

static VOID UI_Normal_Container_List_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Container_List_Desc_t ContListDesc;

    memset(&ContListDesc, 0, sizeof(UI_Normal_Container_List_Desc_t));
    ContListDesc.TitleBar.TxtId    = PHONE_TEXT_ID_TONE_SETTINGS;
    ContListDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    ContListDesc.ContList.ListContainerCnt = 3;
    ContListDesc.ContList.Index            = 0;
    ContListDesc.ContList.ContainerList    = malloc(
        sizeof(UI_Container_Base_Desc_t) * ContListDesc.ContList.ListContainerCnt);
    memset(ContListDesc.ContList.ContainerList, 0,
        sizeof(UI_Container_Base_Desc_t) * ContListDesc.ContList.ListContainerCnt);

    ContListDesc.ContList.ContainerList[0].Valid = TRUE;
    ContListDesc.ContList.ContainerList[1].Valid = TRUE;
    ContListDesc.ContList.ContainerList[2].Valid = TRUE;

    ContListDesc.ContList.ContainerList[0].Label.TxtId      = PHONE_TEXT_ID_VIBRATION_ALERT;
    ContListDesc.ContList.ContainerList[0].Label.LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    ContListDesc.ContList.ContainerList[0].Label.TxtAlign   = LV_LABEL_ALIGN_LEFT;
    ContListDesc.ContList.ContainerList[0].Choise           = UI_BASE_OBJ_LABEL;

    ContListDesc.ContList.ContainerList[0].u.Label2.TxtId      = PHONE_TEXT_ID_ON;
    ContListDesc.ContList.ContainerList[0].u.Label2.LabelAlign = LV_ALIGN_IN_RIGHT_MID;
    ContListDesc.ContList.ContainerList[0].u.Label2.TxtAlign   = LV_LABEL_ALIGN_RIGHT;
    ContListDesc.ContList.ContainerList[0].ReleaseFunc         = UI_Normal_Btn_Release_Func;

    ContListDesc.ContList.ContainerList[1].Label.TxtId      = PHONE_TEXT_ID_RINGING_VOL;
    ContListDesc.ContList.ContainerList[1].Label.LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    ContListDesc.ContList.ContainerList[1].Label.TxtAlign   = LV_LABEL_ALIGN_LEFT;
    ContListDesc.ContList.ContainerList[1].Choise           = UI_BASE_OBJ_BAR;

    ContListDesc.ContList.ContainerList[1].u.Bar.Range    = 5;
    ContListDesc.ContList.ContainerList[1].u.Bar.Value    = 2;
    ContListDesc.ContList.ContainerList[1].u.Bar.BarAlign = LV_ALIGN_IN_BOTTOM_LEFT;
    ContListDesc.ContList.ContainerList[1].ReleaseFunc    = UI_Normal_Btn_Release_Func;

    ContListDesc.ContList.ContainerList[2].Label.TxtId      = PHONE_TEXT_ID_RINGING_TONE;
    ContListDesc.ContList.ContainerList[2].Label.LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    ContListDesc.ContList.ContainerList[2].Label.TxtAlign   = LV_LABEL_ALIGN_LEFT;
    ContListDesc.ContList.ContainerList[2].Choise           = UI_BASE_OBJ_IMG;
    ContListDesc.ContList.ContainerList[2].ReleaseFunc      = UI_Normal_Btn_Release_Func;

    ContListDesc.ContList.ContainerList[2].u.Img.Img      = IMG_WALLPAPER_1_S;
    ContListDesc.ContList.ContainerList[2].u.Img.ImgAlign = LV_ALIGN_IN_BOTTOM_LEFT;

    ContListDesc.ButtonBar.ButtonL.Valid = FALSE;
    ContListDesc.ButtonBar.ButtonM.Valid = TRUE;
    ContListDesc.ButtonBar.ButtonR.Valid = TRUE;

    ContListDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_SELECT;
    ContListDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    ContListDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Container_List_Create(&ContListDesc);
    free(ContListDesc.ContList.ContainerList);
} /* UI_Normal_Container_List_Create_Test */


static VOID UI_Normal_Contact_Search_Button_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Contact_Search_Button_Desc_t SearBtnDesc;

    memset(&SearBtnDesc, 0, sizeof(UI_Normal_Contact_Search_Button_Desc_t));

    SearBtnDesc.TitleBar.TxtId    = PHONE_TEXT_ID_CONTACT;
    SearBtnDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    SearBtnDesc.ButtonContainerTa.ContButtonScrl.ContButton[0].BtnTxt     = "John";
    SearBtnDesc.ButtonContainerTa.ContButtonScrl.ContButton[0].ReleaseFun =
        UI_Normal_Btn_Release_Func;

    SearBtnDesc.ButtonContainerTa.ContButtonScrl.ContButton[1].BtnTxt     = "Jack";
    SearBtnDesc.ButtonContainerTa.ContButtonScrl.ContButton[1].ReleaseFun =
        UI_Normal_Btn_Release_Func;

    SearBtnDesc.ButtonContainerTa.ContLabelTa.ContLabel.TxtAlign  = LV_LABEL_ALIGN_LEFT;
    SearBtnDesc.ButtonContainerTa.ContLabelTa.ContTa.TaTxt        = "J";
    SearBtnDesc.ButtonContainerTa.ContLabelTa.ContTa.TaCursorHide = FALSE;

    SearBtnDesc.ButtonContainerTa.ContButtonScrl.Height = 15;
    SearBtnDesc.ButtonContainerTa.ContButtonScrl.PosY   = 50;

    SearBtnDesc.ButtonBar.ButtonM.Valid = TRUE;
    SearBtnDesc.ButtonBar.ButtonR.Valid = TRUE;

    SearBtnDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_DETAILS;
    SearBtnDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_CLEAR;
    SearBtnDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Contact_Search_Button_Create(&SearBtnDesc);
    lv_label_set_text(SearBtnDesc.ButtonContainerTa.ContLabelTa.ContLabel.Label,
        LV_SYMBOL_EDIT "pinyin");
}


static VOID UI_Normal_Contact_Search_Label_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Contact_Search_Label_Desc_t SearLabelDesc;

    memset(&SearLabelDesc, 0, sizeof(UI_Normal_Contact_Search_Label_Desc_t));

    SearLabelDesc.TitleBar.TxtId    = PHONE_TEXT_ID_CONTACT;
    SearLabelDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    SearLabelDesc.LabelTa.ContLabel.TxtId    = PHONE_TEXT_ID_NOMATCHES;
    SearLabelDesc.LabelTa.ContLabel.TxtAlign = LV_LABEL_ALIGN_CENTER;

    SearLabelDesc.LabelTa.ContLabelTa.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;

    SearLabelDesc.LabelTa.ContLabelTa.ContTa.TaTxt        = "J";
    SearLabelDesc.LabelTa.ContLabelTa.ContTa.TaCursorHide = FALSE;

    SearLabelDesc.ButtonBar.ButtonM.Valid = TRUE;
    SearLabelDesc.ButtonBar.ButtonR.Valid = TRUE;

    SearLabelDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_VIEWALL;
    SearLabelDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_CLEAR;
    SearLabelDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Contact_Search_Label_Create(&SearLabelDesc);
    lv_label_set_text(SearLabelDesc.LabelTa.ContLabelTa.ContLabel.Label, LV_SYMBOL_EDIT "pinyin");
}


static VOID UI_Normal_Date_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Date_Desc_t DateDesc;

    memset(&DateDesc, 0,sizeof(UI_Normal_Date_Desc_t));
    DateDesc.TitleBar.TxtId    = PHONE_TEXT_ID_DATE;
    DateDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    DateDesc.ContDate.RollerDay.RollerType   = UI_ROLLER_TYPE_DAY;
    DateDesc.ContDate.RollerDay.MidValue     = 1;
    DateDesc.ContDate.RollerMonth.RollerType = UI_ROLLER_TYPE_MONTH;
    DateDesc.ContDate.RollerMonth.MidValue   = 1;
    DateDesc.ContDate.RollerYear.RollerType  = UI_ROLLER_TYPE_YEAR;
    DateDesc.ContDate.RollerYear.MidValue    = 2000;

    DateDesc.ButtonBar.ButtonL.Valid = FALSE;
    DateDesc.ButtonBar.ButtonM.Valid = TRUE;
    DateDesc.ButtonBar.ButtonR.Valid = TRUE;

    DateDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    DateDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    DateDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Date_Create(&DateDesc);
}


static VOID UI_Normal_Time_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Time_Desc_t TimeDesc;

    memset(&TimeDesc, 0,sizeof(UI_Normal_Time_Desc_t));
    TimeDesc.TitleBar.TxtId    = PHONE_TEXT_ID_TIME;
    TimeDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    TimeDesc.ContTime.Roller1.RollerType = UI_ROLLER_TYPE_MINUTE;
    TimeDesc.ContTime.Roller1.MidValue   = 0;
    TimeDesc.ContTime.Roller2.RollerType = UI_ROLLER_TYPE_SECOND;
    TimeDesc.ContTime.Roller2.MidValue   = 0;

    TimeDesc.ButtonBar.ButtonL.Valid = FALSE;
    TimeDesc.ButtonBar.ButtonM.Valid = TRUE;
    TimeDesc.ButtonBar.ButtonR.Valid = TRUE;

    TimeDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    TimeDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    TimeDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Time_Create(&TimeDesc);
}

static VOID UI_Normal_Menu_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Menu_Desc_t MenuDesc;

    memset(&MenuDesc, 0, sizeof(UI_Normal_Menu_Desc_t));
    MenuDesc.TitleBar.TxtId    = PHONE_TEXT_ID_SMS;
    MenuDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    MenuDesc.PageMultiButton.ListButtonCnt = 7;
    MenuDesc.PageMultiButton.FocusOnBtn    = 4;
    MenuDesc.PageMultiButton.ButtonList    = malloc(
        sizeof(UI_Menu_Button_Desc_t) * MenuDesc.PageMultiButton.ListButtonCnt);
    memset(MenuDesc.PageMultiButton.ButtonList, 0,
        sizeof(UI_Menu_Button_Desc_t) * MenuDesc.PageMultiButton.ListButtonCnt);
    MenuDesc.PageMultiButton.ButtonList[0].Icon       = IMG_MENU_CALL_LOG;
    MenuDesc.PageMultiButton.ButtonList[0].ReleaseFun = UI_Normal_Btn_Release_Func;

    MenuDesc.PageMultiButton.ButtonList[1].Icon       = IMG_MENU_CONTACT;
    MenuDesc.PageMultiButton.ButtonList[1].ReleaseFun = UI_Normal_Btn_Release_Func;

    MenuDesc.PageMultiButton.ButtonList[2].Icon       = IMG_MENU_ALARM;
    MenuDesc.PageMultiButton.ButtonList[2].ReleaseFun = UI_Normal_Btn_Release_Func;
    MenuDesc.PageMultiButton.ButtonList[3].Icon       = IMG_MENU_CALENDAR;
    MenuDesc.PageMultiButton.ButtonList[3].ReleaseFun = UI_Normal_Btn_Release_Func;
    MenuDesc.PageMultiButton.ButtonList[4].Icon       = IMG_MENU_SMS;
    MenuDesc.PageMultiButton.ButtonList[4].ReleaseFun = UI_Normal_Btn_Release_Func;
    MenuDesc.PageMultiButton.ButtonList[5].Icon       = IMG_MENU_SETTING;
    MenuDesc.PageMultiButton.ButtonList[5].ReleaseFun = UI_Normal_Btn_Release_Func;
    MenuDesc.PageMultiButton.ButtonList[6].Icon       = IMG_MENU_CALCULATOR;
    MenuDesc.PageMultiButton.ButtonList[6].ReleaseFun = UI_Normal_Btn_Release_Func;
    /*  MenuDesc.PageMultiButton.ButtonList[7].Icon       = (lv_img_dsc_t *)&img_flower_icon;
     * MenuDesc.PageMultiButton.ButtonList[7].ReleaseFun = UI_Normal_Btn_Release_Func;
     * MenuDesc.PageMultiButton.ButtonList[8].Icon       = (lv_img_dsc_t *)&img_flower_icon;
     * MenuDesc.PageMultiButton.ButtonList[8].ReleaseFun = UI_Normal_Btn_Release_Func;*/

    MenuDesc.ButtonBar.ButtonL.Valid = FALSE;
    MenuDesc.ButtonBar.ButtonM.Valid = TRUE;
    MenuDesc.ButtonBar.ButtonR.Valid = TRUE;

    MenuDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_SELECT;
    MenuDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    MenuDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Normal_Menu_Create(&MenuDesc);

    free(MenuDesc.PageMultiButton.ButtonList);
} /* UI_Normal_Menu_Create_Test */


static VOID  UI_Normal_Alarm_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Alarm_Desc_t AlarmDesc;

    memset(&AlarmDesc, 0, sizeof(UI_Normal_Alarm_Desc_t));
    AlarmDesc.TitleBar.TxtId    = PHONE_TEXT_ID_ALARM;
    AlarmDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    AlarmDesc.AnimLabel.TxtId       = (12 << 8) + 20; // 12:20
    AlarmDesc.AnimLabel.TxtAlign    = LV_LABEL_ALIGN_CENTER;
    AlarmDesc.AnimLabel.SymbolAlign = LV_LABEL_ALIGN_CENTER;

    AlarmDesc.ButtonBar.ButtonL.Valid = FALSE;
    AlarmDesc.ButtonBar.ButtonM.Valid = TRUE;
    AlarmDesc.ButtonBar.ButtonR.Valid = TRUE;

    AlarmDesc.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_STOP;
    AlarmDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_SNOOZE;
    AlarmDesc.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Alarm_Create(&AlarmDesc);

    // lv_label_set_text(AlarmDesc.AnimLabel.Label, "12:20");
}


static VOID UI_Status_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_Status_Desc_t Status;

    memset(&Status, 0, sizeof(UI_Status_Desc_t));

    Status.ContLabel.TxtId = PHONE_TEXT_ID_NUM_ALREADY_ON;
    Status.ContLabelAlign  = LV_ALIGN_IN_TOP_LEFT;
    Status.ContImgAlign    = LV_ALIGN_IN_TOP_RIGHT;
    Status.ContImg.Img     = (lv_img_dsc_t *)SYMBOL_CHECKED;
    Status.KeyFunc         = UI_Normal_Test_KeyFunc;
    UI_Status_Create(&Status);
}


static VOID UI_Normal_NoTitle_Label_Ta_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_NoTitle_Label_Ta_Desc_t NotitleLabelTa;

    memset(&NotitleLabelTa, 0, sizeof(UI_Normal_NoTitle_Label_Ta_Desc_t));
    NotitleLabelTa.ContLabelTl.TxtId = LV_LANG_TXT_ID_NONE;

    NotitleLabelTa.ContLabelTl.SymbolId    = LV_SYMBOL_EDIT "pinyin";
    NotitleLabelTa.ContLabelTl.SymbolAlign = LV_LABEL_ALIGN_LEFT;

    NotitleLabelTa.ContLabelTr.TxtAlign = LV_LABEL_ALIGN_CENTER;
    NotitleLabelTa.ContLabelTr.TxtId    = LV_LANG_TXT_ID_NONE;

    NotitleLabelTa.ContLabel.TxtId = PHONE_TEXT_ID_REMINDER_ABOUT;

    NotitleLabelTa.ContTa.TaCursorHide = FALSE;
    NotitleLabelTa.ContTa.TaAlign      = LV_ALIGN_IN_BOTTOM_LEFT;
    NotitleLabelTa.ContTa.TaTxt        = "Meeting";

    NotitleLabelTa.ButtonCont.ButtonL.Valid = FALSE;
    NotitleLabelTa.ButtonCont.ButtonM.Valid = TRUE;
    NotitleLabelTa.ButtonCont.ButtonR.Valid = TRUE;

    NotitleLabelTa.ButtonCont.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    NotitleLabelTa.ButtonCont.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    NotitleLabelTa.KeyFunc                  = UI_Normal_TaTest_KeyFunc;

    UI_Normal_NoTitle_Label_Ta_Create(&NotitleLabelTa);

    lv_label_set_text(NotitleLabelTa.ContLabelTr.Label, "7/45");
}


static VOID UI_Normal_Switch_Off_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Container_List_Desc_t Switchoff;

    memset(&Switchoff, 0, sizeof(UI_Normal_Container_List_Desc_t));

    Switchoff.ContList.ListContainerCnt = 2;
    Switchoff.ContList.ContainerList    = malloc(
        sizeof(UI_Container_Base_Desc_t) * Switchoff.ContList.ListContainerCnt);
    memset(Switchoff.ContList.ContainerList, 0,
        sizeof(UI_Container_Base_Desc_t) * Switchoff.ContList.ListContainerCnt);

    Switchoff.ContList.ContainerList[1].Label.TxtId      = PHONE_TEXT_ID_SWITCH_OFF;
    Switchoff.ContList.ContainerList[1].Label.LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    Switchoff.ContList.ContainerList[1].Label.TxtAlign   = LV_LABEL_ALIGN_LEFT;
    Switchoff.ContList.ContainerList[1].Choise           = UI_BASE_OBJ_NULL;
    Switchoff.ContList.ContainerList[1].ReleaseFunc      = UI_Normal_Btn_Release_Func;
    Switchoff.ContList.ContainerList[1].Valid            = TRUE;

    Switchoff.ContList.ContainerList[0].Label.TxtId      = PHONE_TEXT_ID_VOLUME;
    Switchoff.ContList.ContainerList[0].Label.LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    Switchoff.ContList.ContainerList[0].Label.TxtAlign   = LV_LABEL_ALIGN_LEFT;
    Switchoff.ContList.ContainerList[0].Choise           = UI_BASE_OBJ_BAR;

    Switchoff.ContList.ContainerList[0].u.Bar.Range    = 5;
    Switchoff.ContList.ContainerList[0].u.Bar.Value    = 2;
    Switchoff.ContList.ContainerList[0].u.Bar.BarAlign = LV_ALIGN_IN_BOTTOM_LEFT;
    Switchoff.ContList.ContainerList[0].ReleaseFunc    = UI_Normal_Btn_Release_Func;
    Switchoff.ContList.ContainerList[0].Valid          = TRUE;

    Switchoff.ButtonBar.ButtonL.Valid = TRUE;
    Switchoff.ButtonBar.ButtonM.Valid = TRUE;
    Switchoff.ButtonBar.ButtonR.Valid = TRUE;

    Switchoff.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_LOCK;
    Switchoff.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    Switchoff.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    Switchoff.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Switch_Off_Create(&Switchoff);
}


static VOID UI_Normal_Button_Container_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Button_Container_Desc_t BtnCont;

    memset(&BtnCont, 0,sizeof(UI_Normal_Button_Container_Desc_t));

    BtnCont.TitleBar.TxtId    = PHONE_TEXT_ID_CONTACT;
    BtnCont.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    BtnCont.Label.TxtId    = LV_LANG_TXT_ID_NONE;// PHONE_TEXT_ID_EMPTY;
    BtnCont.Label.TxtAlign = LV_LABEL_ALIGN_CENTER;

    BtnCont.ButtonContainer.Height = 10;
    BtnCont.ButtonContainer.PosY   = 0;
    BtnCont.ButtonContainer.Index  = 0;

    BtnCont.ButtonContainer.ContButton[0].Valid = TRUE;
    BtnCont.ButtonContainer.ContButton[1].Valid = TRUE;
    BtnCont.ButtonContainer.ContButton[2].Valid = TRUE;

    BtnCont.ButtonContainer.ContButton[0].BtnTxt     = "Ann";
    BtnCont.ButtonContainer.ContButton[0].SymbolId1  = LV_SYMBOL_AUDIO;
    BtnCont.ButtonContainer.ContButton[0].SymbolId2  = LV_SYMBOL_BELL;
    BtnCont.ButtonContainer.ContButton[0].ReleaseFun = UI_Normal_Btn_Release_Func;

    BtnCont.ButtonContainer.ContButton[1].BtnTxt     = "Jack";
    BtnCont.ButtonContainer.ContButton[1].SymbolId1  = LV_SYMBOL_CALL;
    BtnCont.ButtonContainer.ContButton[1].SymbolId2  = LV_SYMBOL_PREV;
    BtnCont.ButtonContainer.ContButton[1].ReleaseFun = UI_Normal_Btn_Release_Func;

    BtnCont.ButtonContainer.ContButton[2].BtnTxt     = "Jim";
    BtnCont.ButtonContainer.ContButton[2].SymbolId1  = LV_SYMBOL_SETTINGS;
    BtnCont.ButtonContainer.ContButton[2].SymbolId2  = LV_SYMBOL_MUTE;
    BtnCont.ButtonContainer.ContButton[2].ReleaseFun = UI_Normal_Btn_Release_Func;

    BtnCont.ButtonBar.ButtonL.Valid = FALSE;
    BtnCont.ButtonBar.ButtonM.Valid = TRUE;
    BtnCont.ButtonBar.ButtonR.Valid = TRUE;

    BtnCont.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_DETAILS;
    BtnCont.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    BtnCont.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Button_Container_Create(&BtnCont);
} /* UI_Normal_Button_Container_Create_Test */


static VOID UI_Desktop_Unlock_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Desktop_Unlock_Desc_t Desktop;

    memset(&Desktop, 0, sizeof(UI_Desktop_Unlock_Desc_t));

    Desktop.Wall_Paper_Img = IMG_WALLPAPER_1;

    Desktop.ContLabel[0].TxtAlign = LV_LABEL_ALIGN_CENTER;
    Desktop.ContLabel[1].TxtAlign = LV_LABEL_ALIGN_CENTER;
    Desktop.ContLabel[0].TxtFont  = LV_FONT_PTR_DRIODSANSFALLBACKFULL_SMALL;

    Desktop.ButtonBar.ButtonL.Valid = TRUE;
    Desktop.ButtonBar.ButtonM.Valid = FALSE;
    Desktop.ButtonBar.ButtonR.Valid = FALSE;

    Desktop.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_UNLOCK;
    Desktop.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Desktop_Unlock_Create(&Desktop);

    lv_label_set_text(Desktop.ContLabel[0].Label, "15:49");
    lv_label_set_text(Desktop.ContLabel[1].Label, "2019.04.25");
}


static VOID UI_Desktop_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_Desktop_Desc_t Desktop;

    memset(&Desktop, 0, sizeof(UI_Desktop_Desc_t));

    Desktop.Wall_Paper_Img         = IMG_WALLPAPER_1;
    Desktop.Oper_Label[0].TxtAlign = LV_LABEL_ALIGN_LEFT;
    Desktop.Oper_Label[1].TxtAlign = LV_LABEL_ALIGN_LEFT;

    Desktop.ContLabel[0].TxtAlign = LV_LABEL_ALIGN_CENTER;
    Desktop.ContLabel[1].TxtAlign = LV_LABEL_ALIGN_CENTER;
    Desktop.ContLabel[0].TxtFont  = LV_FONT_PTR_DRIODSANSFALLBACKFULL_SMALL;

    Desktop.ButtonBar.ButtonL.Valid = TRUE;
    Desktop.ButtonBar.ButtonM.Valid = TRUE;
    Desktop.ButtonBar.ButtonR.Valid = TRUE;

    Desktop.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_GOTO;
    Desktop.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_MENU;
    Desktop.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_ALARM;
    Desktop.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Desktop_Create(&Desktop);

    lv_label_set_text(Desktop.Oper_Label[0].Label,LV_SYMBOL_WIFI "CMCC");
    lv_label_set_text(Desktop.Oper_Label[1].Label,LV_SYMBOL_WIFI "CUCC");

    lv_label_set_text(Desktop.ContLabel[0].Label, "15:49");
    lv_label_set_text(Desktop.ContLabel[1].Label, "2019.04.25");
}


static VOID UI_Calendar_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Calendar_Only_Desc_t Calendar;

    memset(&Calendar, 0, sizeof(UI_Calendar_Only_Desc_t));
    Calendar.Calendar.Today.day   = 25;
    Calendar.Calendar.Today.month = 4;
    Calendar.Calendar.Today.year  = 2019;

    Calendar.Calendar.ShowedDate.day   = 25;
    Calendar.Calendar.ShowedDate.month = 4;
    Calendar.Calendar.ShowedDate.year  = 2019;

    /* Calendar.Calendar.HighlitedDaysCnt = 3; */

    /* Calendar.Calendar.HighlihtedDays = malloc( */
    /*     sizeof(lv_calendar_date_t) * Calendar.Calendar.HighlitedDaysCnt); */
    /* memset(Calendar.Calendar.HighlihtedDays, 0, */
    /*     sizeof(lv_calendar_date_t) * Calendar.Calendar.HighlitedDaysCnt); */

    /* Calendar.Calendar.HighlihtedDays[0].day   = 10; */
    /* Calendar.Calendar.HighlihtedDays[0].month = 4; */
    /* Calendar.Calendar.HighlihtedDays[0].year  = 2019; */
    /* Calendar.Calendar.HighlihtedDays[1].day   = 14; */
    /* Calendar.Calendar.HighlihtedDays[1].month = 4; */
    /* Calendar.Calendar.HighlihtedDays[1].year  = 2019; */
    /* Calendar.Calendar.HighlihtedDays[2].day   = 20; */
    /* Calendar.Calendar.HighlihtedDays[2].month = 4; */
    /* Calendar.Calendar.HighlihtedDays[2].year  = 2019; */

    Calendar.ButtonBar.ButtonL.Valid = TRUE;
    Calendar.ButtonBar.ButtonM.Valid = FALSE;
    Calendar.ButtonBar.ButtonR.Valid = TRUE;

    Calendar.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_OPT;
    Calendar.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    Calendar.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Calendar_Create(&Calendar);

    // free(Calendar.Calendar.HighlihtedDays);
}


static VOID UI_Normal_Reminder_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Reminder_Desc_t Reminder;

    memset(&Reminder, 0, sizeof(UI_Normal_Reminder_Desc_t));
    Reminder.TitleLabelL.TxtAlign = LV_LABEL_ALIGN_LEFT;
    Reminder.TitleLabelR.TxtAlign = LV_LABEL_ALIGN_RIGHT;

    Reminder.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;

    Reminder.ButtonCont.ButtonL.Valid = FALSE;
    Reminder.ButtonCont.ButtonM.Valid = TRUE;
    Reminder.ButtonCont.ButtonR.Valid = TRUE;

    Reminder.ButtonCont.ButtonM.TxtId = PHONE_TEXT_ID_DELETE;
    Reminder.ButtonCont.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    Reminder.KeyFunc                  = UI_Normal_Test_KeyFunc;
    UI_Normal_Reminder_Create(&Reminder);

    lv_label_set_text(Reminder.TitleLabelL.Label,"1");
    lv_label_set_text(Reminder.TitleLabelR.Label,"16:30");
    lv_label_set_text(Reminder.ContLabel.Label,LV_SYMBOL_BELL "Metting");
}


static VOID UI_Status_Label_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Status_Label_Desc_t StaLabel;

    memset(&StaLabel, 0, sizeof(UI_Status_Label_Desc_t));
    StaLabel.ContLabel[1].TxtId = PHONE_TEXT_ID_SIM1;
    StaLabel.KeyFunc            = UI_Normal_Test_KeyFunc;

    UI_Status_Label_Create(&StaLabel);
    lv_label_set_text(StaLabel.ContLabel[0].Label, LV_SYMBOL_CALL "Jack");
}


VOID UI_Normal_NoTitle_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_NoTitle_Desc_t Notitle;

    memset(&Notitle, 0, sizeof(UI_Normal_NoTitle_Desc_t));
    Notitle.ContenCont.ContLabel.TxtId    = PHONE_TEXT_ID_HIGH_VOL_WARNING;
    Notitle.ContenCont.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;

    Notitle.ButtonBar.ButtonL.Valid = FALSE;
    Notitle.ButtonBar.ButtonM.Valid = TRUE;
    Notitle.ButtonBar.ButtonR.Valid = TRUE;

    Notitle.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_OK;
    Notitle.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_CANCEL;
    Notitle.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_NoTitle_Create(&Notitle);
}


static VOID UI_Normal_NoTitle_Ta_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_NoTitle_Ta_Desc_t NotitleTa;

    memset(&NotitleTa, 0, sizeof(UI_Normal_NoTitle_Ta_Desc_t));
    NotitleTa.ContLabelTl.TxtAlign = LV_LABEL_ALIGN_LEFT;
    NotitleTa.ContLabelTr.TxtAlign = LV_LABEL_ALIGN_CENTER;
    NotitleTa.ContTa.TaTxt         = "This is a message";
    NotitleTa.ContTa.TaCursorHide  = FALSE;

    NotitleTa.ButtonBar.ButtonL.Valid = TRUE;
    NotitleTa.ButtonBar.ButtonM.Valid = FALSE;
    NotitleTa.ButtonBar.ButtonR.Valid = TRUE;

    NotitleTa.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_OPT;
    NotitleTa.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_CLEAR;
    NotitleTa.KeyFunc                 = UI_Normal_TaTest_KeyFunc;
    UI_Normal_NoTitle_Ta_Create(&NotitleTa);
    lv_label_set_text(NotitleTa.ContLabelTl.Label,LV_SYMBOL_EDIT "Abc");
    lv_label_set_text(NotitleTa.ContLabelTr.Label, "899/1");
}


static VOID UI_Normal_Sms_Insert_Symbol_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Sms_Insert_Symbol_Desc_t SmsInsert;

    memset(&SmsInsert, 0, sizeof(UI_Normal_Sms_Insert_Symbol_Desc_t));
    SmsInsert.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;
    static const char *btnm_map[] =
    {
        "&", "#", "@", "$", "^", "\n",
        "*", "(", ")", "!", "<", "\n",
        "&", "#", "@", "$", "^", "\n",
        "&", "#", "@", "$", "^", "\n",
        "&", "#", "@", "$", "^", "\n",
        ">", "?", ""
    };
    SmsInsert.ContBtnm.BtnmTxt    = (INT8 *)btnm_map;
    SmsInsert.ContBtnm.ReleaseFun = UI_Normal_Btn_Release_Func;

    SmsInsert.ButtonBar.ButtonL.Valid = FALSE;
    SmsInsert.ButtonBar.ButtonM.Valid = TRUE;
    SmsInsert.ButtonBar.ButtonR.Valid = TRUE;

    SmsInsert.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_USE;
    SmsInsert.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    SmsInsert.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Sms_Insert_Symbol_Create(&SmsInsert);
    lv_label_set_text(SmsInsert.ContLabel.Label, LV_SYMBOL_EDIT "$#*");
}


static VOID UI_Normal_Reminder_Alarm_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Reminder_Alarm_Desc_t RemAlarm;

    memset(&RemAlarm, 0, sizeof(UI_Normal_Reminder_Alarm_Desc_t));

    RemAlarm.ContImg.Img         = IMG_MENU_ALARM;
    RemAlarm.ContLabelR.TxtAlign = LV_LABEL_ALIGN_LEFT;
    RemAlarm.ContLabelD.TxtAlign = LV_LABEL_ALIGN_LEFT;

    RemAlarm.ButtonBar.ButtonL.Valid = FALSE;
    RemAlarm.ButtonBar.ButtonM.Valid = TRUE;
    RemAlarm.ButtonBar.ButtonR.Valid = TRUE;

    RemAlarm.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_USE;
    RemAlarm.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_QUIT;
    RemAlarm.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Reminder_Alarm_Create(&RemAlarm);
    lv_label_set_text(RemAlarm.ContLabelR.Label, "16:56\n04/28/2019");
    lv_label_set_text(RemAlarm.ContLabelD.Label, "Meeting");
}

static VOID UI_Normal_NoTitle_Labels_Bar_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_NoTitle_Labels_Bar_Desc_t LabelBar;

    memset(&LabelBar, 0, sizeof(UI_Normal_NoTitle_Labels_Bar_Desc_t));

    LabelBar.ContLabel[0].TxtId  = LV_LANG_TXT_ID_NONE;
    LabelBar.ContLabel[0].ImgSrc = IMG_CALL_HOLD;

    LabelBar.ContLabel[1].TxtId  = LV_LANG_TXT_ID_NONE;
    LabelBar.ContLabel[1].ImgSrc = IMG_CALL_CALLING;

    LabelBar.ContLabel[3].TxtId    = PHONE_TEXT_ID_SIM2;
    LabelBar.ContLabel[3].SymbolId = SYMBOL_SIM2;

    LabelBar.Bar.Range = 6;
    LabelBar.Bar.Value = 3;

    LabelBar.ButtonBar.ButtonL.Valid = FALSE;
    LabelBar.ButtonBar.ButtonM.Valid = FALSE;
    LabelBar.ButtonBar.ButtonR.Valid = TRUE;

    LabelBar.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_SILENCE;
    LabelBar.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_NoTitle_Labels_Bar_Create(&LabelBar);
    lv_label_set_text(LabelBar.ContLabel[0].Label, "Jack");
    lv_label_set_text(LabelBar.ContLabel[1].Label, "Sara");
    lv_label_set_text(LabelBar.ContLabel[2].Label, "00:02:40");
}


static VOID UI_FullScreen_Label_Only_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_FullScreen_Label_Only_Desc_t FullLabel;

    memset(&FullLabel, 0, sizeof(UI_FullScreen_Label_Only_Desc_t));
    FullLabel.ContLabel.TxtAlign = LV_LABEL_ALIGN_CENTER;
    FullLabel.KeyFunc            = UI_Normal_Test_KeyFunc;
    UI_FullScreen_Label_Only_Create(&FullLabel);
    lv_label_set_text(FullLabel.ContLabel.Label,
        "Adversity does not build character, it reveals it.");
}


static VOID UI_FullScreen_Key_Guard_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_FullScreen_Key_Guard_Desc_t KeyGuard;

    memset(&KeyGuard, 0, sizeof(UI_FullScreen_Key_Guard_Desc_t));

    KeyGuard.TimeLabel.TxtAlign = LV_LABEL_ALIGN_CENTER;
    KeyGuard.DateLabel.TxtAlign = LV_LABEL_ALIGN_CENTER;
    KeyGuard.TimeLabel.TxtFont  = LV_FONT_PTR_DRIODSANSFALLBACKFULL_SMALL;

    KeyGuard.KeyFunc = UI_Normal_Test_KeyFunc;
    UI_FullScreen_Key_Guard_Create(&KeyGuard);

    lv_label_set_text(KeyGuard.TimeLabel.Label,"19:24");
    lv_label_set_text(KeyGuard.DateLabel.Label,"2019.4.28");
}


static VOID UI_Normal_Calculator_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_Normal_Calculator_Desc_t Cal;

    memset(&Cal, 0, sizeof(UI_Normal_Calculator_Desc_t));

    Cal.ContTa.TaCursorHide = TRUE;
    Cal.ContTa.TaTxt        = "0";
    Cal.ContTa.TaAlign      = LV_LABEL_ALIGN_RIGHT;

    Cal.ContLabel.ContLabelU.TxtId = LV_LANG_TXT_ID_NONE;
    Cal.ContLabel.ContLabelL.TxtId = LV_LANG_TXT_ID_NONE;
    Cal.ContLabel.ContLabelR.TxtId = LV_LANG_TXT_ID_NONE;
    Cal.ContLabel.ContLabelD.TxtId = LV_LANG_TXT_ID_NONE;

    Cal.ContLabel.ContLabelU.SymbolAlign = LV_LABEL_ALIGN_CENTER;
    Cal.ContLabel.ContLabelL.SymbolAlign = LV_LABEL_ALIGN_CENTER;
    Cal.ContLabel.ContLabelR.SymbolAlign = LV_LABEL_ALIGN_CENTER;
    Cal.ContLabel.ContLabelD.SymbolAlign = LV_LABEL_ALIGN_CENTER;

    Cal.ContLabel.ContLabelU.SymbolId = LV_SYMBOL_PLUS;
    Cal.ContLabel.ContLabelL.SymbolId = LV_SYMBOL_CLOSE;
    Cal.ContLabel.ContLabelR.SymbolId = LV_SYMBOL_PLUS;
    Cal.ContLabel.ContLabelD.SymbolId = LV_SYMBOL_MINUS;

    Cal.ButtonBar.ButtonL.Valid = FALSE;
    Cal.ButtonBar.ButtonM.Valid = TRUE;
    Cal.ButtonBar.ButtonR.Valid = TRUE;

    Cal.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_EQUALS;
    Cal.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_BACK;
    Cal.KeyFunc                 = UI_Normal_Test_KeyFunc;
    UI_Normal_Calculator_Create(&Cal);
}


static VOID UI_FullScreen_Label_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }
    UI_FullScreen_Label_Desc_t FullLable;

    memset(&FullLable, 0, sizeof(UI_FullScreen_Label_Desc_t));

    FullLable.BatteryLabel.SymbolId    = LV_SYMBOL_CHARGE;
    FullLable.BatteryLabel.TxtId       = LV_LANG_TXT_ID_NONE;
    FullLable.BatteryLabel.SymbolAlign = LV_LABEL_ALIGN_CENTER;

    /*  FullLable.ChargeLabel.SymbolId    = LV_SYMBOL_CHARGE;
     * FullLable.ChargeLabel.TxtId       = LV_LANG_TXT_ID_NONE;
     * FullLable.ChargeLabel.SymbolAlign = LV_LABEL_ALIGN_CENTER;*/

    FullLable.KeyFunc = UI_Normal_Test_KeyFunc;

    UI_FullScreen_Label_Create(&FullLable);
}


static VOID UI_Desktop_Prompt_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_Desktop_Prompt_Desc_t Prompt;

    memset(&Prompt, 0, sizeof(UI_Desktop_Prompt_Desc_t));

    Prompt.Oper_Label[0].TxtAlign = LV_LABEL_ALIGN_LEFT;
    Prompt.Oper_Label[1].TxtAlign = LV_LABEL_ALIGN_LEFT;

    Prompt.ContLabel.TxtAlign = LV_LABEL_ALIGN_LEFT;

    Prompt.ButtonBar.ButtonL.Valid = FALSE;
    Prompt.ButtonBar.ButtonM.Valid = TRUE;
    Prompt.ButtonBar.ButtonR.Valid = TRUE;

    Prompt.ButtonBar.ButtonM.TxtId = PHONE_TEXT_ID_LIST;
    Prompt.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_EXIT;
    Prompt.KeyFunc                 = UI_Normal_Test_KeyFunc;

    UI_Desktop_Prompt_Create(&Prompt);

    lv_label_set_text(Prompt.ContLabel.Label, "2 messages received\n5 missed calls");
}


static VOID UI_DialPad_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_DialPad_Desc_t DialPadDesc;

    memset(&DialPadDesc, 0, sizeof(UI_DialPad_Desc_t));

    DialPadDesc.PadTa.TaTxt        = "1234";
    DialPadDesc.PadTa.TaCursorHide = FALSE;

    DialPadDesc.Oper_Label[0].TxtId      = LV_LANG_TXT_ID_NONE;
    DialPadDesc.Oper_Label[0].TxtAlign   = LV_LABEL_ALIGN_LEFT;
    DialPadDesc.Oper_Label[0].LabelAlign = LV_ALIGN_IN_TOP_LEFT;
    DialPadDesc.Oper_Label[1].TxtId      = LV_LANG_TXT_ID_NONE;
    DialPadDesc.Oper_Label[1].TxtAlign   = LV_LABEL_ALIGN_LEFT;
    DialPadDesc.Oper_Label[1].LabelAlign = LV_ALIGN_OUT_BOTTOM_LEFT;

    DialPadDesc.ButtonBar.ButtonL.Valid = TRUE;
    DialPadDesc.ButtonBar.ButtonL.TxtId = PHONE_TEXT_ID_OPT;
    DialPadDesc.ButtonBar.ButtonM.Valid = FALSE;
    DialPadDesc.ButtonBar.ButtonR.Valid = TRUE;
    DialPadDesc.ButtonBar.ButtonR.TxtId = PHONE_TEXT_ID_CLEAR;

    DialPadDesc.KeyFunc = UI_Normal_TaTest_KeyFunc;

    UI_DialPad_Create(&DialPadDesc);
}


VOID UI_Status_Bar_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_Status_Bar_Desc_t StaBar;

    memset(&StaBar, 0, sizeof(UI_Status_Bar_Desc_t));

    StaBar.BatteryLabel.TxtAlign    = LV_LABEL_ALIGN_RIGHT;
    StaBar.BatteryLabel.SymbolAlign = LV_LABEL_ALIGN_RIGHT;
    StaBar.BatteryLabel.TxtId       = LV_LANG_TXT_ID_NONE;
    StaBar.BatteryLabel.SymbolId    = LV_SYMBOL_BATTERY_3;
    UI_Status_Bar_Create(&StaBar);
}


static VOID UI_Normal_List_Only_Create_Test(lv_obj_t * Obj, lv_event_t Event)
{
    UI_Normal_List_Only_Desc_t ListDesc;

    memset(&ListDesc, 0, sizeof(UI_Normal_List_Only_Desc_t));

    ListDesc.TitleBar.TxtAlign = LV_LABEL_ALIGN_CENTER;

    ListDesc.List.ListButtonCnt = UI_COMMON_TEST_LIST_CNT;
    ListDesc.List.Index         = ListIndex;

    ListDesc.List.ButtonList = malloc(sizeof(UI_Button_Desc_t) * ListDesc.List.ListButtonCnt);
    memset(ListDesc.List.ButtonList, 0, sizeof(UI_Button_Desc_t) * ListDesc.List.ListButtonCnt);

    ListDesc.List.ButtonList[0].Valid  = TRUE;
    ListDesc.List.ButtonList[1].Valid  = TRUE;
    ListDesc.List.ButtonList[2].Valid  = TRUE;
    ListDesc.List.ButtonList[3].Valid  = TRUE;
    ListDesc.List.ButtonList[4].Valid  = TRUE;
    ListDesc.List.ButtonList[5].Valid  = TRUE;
    ListDesc.List.ButtonList[6].Valid  = TRUE;
    ListDesc.List.ButtonList[7].Valid  = TRUE;
    ListDesc.List.ButtonList[8].Valid  = TRUE;
    ListDesc.List.ButtonList[9].Valid  = TRUE;
    ListDesc.List.ButtonList[10].Valid = TRUE;
    ListDesc.List.ButtonList[11].Valid = TRUE;
    ListDesc.List.ButtonList[12].Valid = TRUE;
    ListDesc.List.ButtonList[13].Valid = TRUE;
    ListDesc.List.ButtonList[14].Valid = TRUE;
    ListDesc.List.ButtonList[15].Valid = TRUE;
    ListDesc.List.ButtonList[16].Valid = TRUE;
    ListDesc.List.ButtonList[17].Valid = TRUE;
    ListDesc.List.ButtonList[18].Valid = TRUE;
    ListDesc.List.ButtonList[19].Valid = TRUE;
    ListDesc.List.ButtonList[20].Valid = TRUE;
    ListDesc.List.ButtonList[21].Valid = TRUE;
    ListDesc.List.ButtonList[22].Valid = TRUE;
    ListDesc.List.ButtonList[23].Valid = TRUE;
    ListDesc.List.ButtonList[24].Valid = TRUE;
    ListDesc.List.ButtonList[25].Valid = TRUE;
    ListDesc.List.ButtonList[26].Valid = TRUE;
    ListDesc.List.ButtonList[27].Valid = TRUE;
    ListDesc.List.ButtonList[28].Valid = TRUE;
    ListDesc.List.ButtonList[29].Valid = TRUE;

    ListDesc.List.ButtonList[0].SymbolId1 = LV_SYMBOL_FILE;
    ListDesc.List.ButtonList[1].SymbolId1 = LV_SYMBOL_IMAGE;
    ListDesc.List.ButtonList[2].SymbolId1 = LV_SYMBOL_WIFI;
    ListDesc.List.ButtonList[3].SymbolId1 = LV_SYMBOL_CUT;
    ListDesc.List.ButtonList[4].SymbolId1 = LV_SYMBOL_COPY;
    ListDesc.List.ButtonList[5].SymbolId1 = LV_SYMBOL_SAVE;

    ListDesc.List.ButtonList[0].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[0].BtnTxt     = "Label Only";
    ListDesc.List.ButtonList[0].ReleaseFun = UI_Normal_Label_Only_Create_Test;

    ListDesc.List.ButtonList[1].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[1].BtnTxt     = "Ta Only";
    ListDesc.List.ButtonList[1].ReleaseFun = UI_Normal_Ta_Only_Create_Test;

    ListDesc.List.ButtonList[2].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[2].BtnTxt     = "Cont List";
    ListDesc.List.ButtonList[2].ReleaseFun = UI_Normal_Container_List_Create_Test;

    ListDesc.List.ButtonList[3].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[3].BtnTxt     = "Date";
    ListDesc.List.ButtonList[3].ReleaseFun = UI_Normal_Date_Create_Test;

    ListDesc.List.ButtonList[4].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[4].BtnTxt     = "Contact Search btn";
    ListDesc.List.ButtonList[4].ReleaseFun =
        UI_Normal_Contact_Search_Button_Create_Test;

    ListDesc.List.ButtonList[5].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[5].BtnTxt     = "Contact Search label";
    ListDesc.List.ButtonList[5].ReleaseFun =
        UI_Normal_Contact_Search_Label_Create_Test;

    ListDesc.List.ButtonList[6].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[6].BtnTxt     = "Menu";
    ListDesc.List.ButtonList[6].ReleaseFun = UI_Normal_Menu_Create_Test;

    ListDesc.List.ButtonList[7].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[7].BtnTxt     = "Alarm";
    ListDesc.List.ButtonList[7].ReleaseFun = UI_Normal_Alarm_Create_Test;

    ListDesc.List.ButtonList[8].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[8].BtnTxt     = "Status";
    ListDesc.List.ButtonList[8].ReleaseFun = UI_Status_Create_Test;

    ListDesc.List.ButtonList[9].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[9].BtnTxt     = "NoTitleLabelTa";
    ListDesc.List.ButtonList[9].ReleaseFun = UI_Normal_NoTitle_Label_Ta_Create_Test;

    ListDesc.List.ButtonList[10].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[10].BtnTxt     = "SwitchOff";
    ListDesc.List.ButtonList[10].ReleaseFun = UI_Normal_Switch_Off_Create_Test;

    ListDesc.List.ButtonList[11].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[11].BtnTxt     = "BtnContainer";
    ListDesc.List.ButtonList[11].ReleaseFun = UI_Normal_Button_Container_Create_Test;

    ListDesc.List.ButtonList[12].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[12].BtnTxt     = "DesktopUnlock";
    ListDesc.List.ButtonList[12].ReleaseFun = UI_Desktop_Unlock_Create_Test;

    ListDesc.List.ButtonList[13].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[13].BtnTxt     = "Reminder";
    ListDesc.List.ButtonList[13].ReleaseFun = UI_Normal_Reminder_Create_Test;

    ListDesc.List.ButtonList[14].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[14].BtnTxt     = "Status Label";
    ListDesc.List.ButtonList[14].ReleaseFun = UI_Status_Label_Create_Test;

    ListDesc.List.ButtonList[15].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[15].BtnTxt     = "Notitle";
    ListDesc.List.ButtonList[15].ReleaseFun = UI_Normal_NoTitle_Create_Test;

    ListDesc.List.ButtonList[16].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[16].BtnTxt     = "DeskTop";
    ListDesc.List.ButtonList[16].ReleaseFun = UI_Desktop_Create_Test;

    ListDesc.List.ButtonList[18].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[18].BtnTxt     = "NotitleTa";
    ListDesc.List.ButtonList[18].ReleaseFun = UI_Normal_NoTitle_Ta_Create_Test;

    ListDesc.List.ButtonList[19].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[19].BtnTxt     = "SmsInsertSymbol";
    ListDesc.List.ButtonList[19].ReleaseFun = UI_Normal_Sms_Insert_Symbol_Create_Test;

    ListDesc.List.ButtonList[20].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[20].BtnTxt     = "Reminder Alarm";
    ListDesc.List.ButtonList[20].ReleaseFun = UI_Normal_Reminder_Alarm_Create_Test;

    ListDesc.List.ButtonList[21].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[21].BtnTxt     = "NoTitle LabelBar";
    ListDesc.List.ButtonList[21].ReleaseFun = UI_Normal_NoTitle_Labels_Bar_Create_Test;

    ListDesc.List.ButtonList[22].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[22].BtnTxt     = "FullScreenLabelOnly";
    ListDesc.List.ButtonList[22].ReleaseFun = UI_FullScreen_Label_Only_Create_Test;

    ListDesc.List.ButtonList[23].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[23].BtnTxt     = "KeyGuard";
    ListDesc.List.ButtonList[23].ReleaseFun = UI_FullScreen_Key_Guard_Create_Test;

    ListDesc.List.ButtonList[24].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[24].BtnTxt     = "Calculator";
    ListDesc.List.ButtonList[24].ReleaseFun = UI_Normal_Calculator_Create_Test;

    ListDesc.List.ButtonList[25].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[25].BtnTxt     = "FullScreenLabel";
    ListDesc.List.ButtonList[25].ReleaseFun = UI_FullScreen_Label_Create_Test;

    ListDesc.List.ButtonList[26].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[26].BtnTxt     = "Canlendar";
    ListDesc.List.ButtonList[26].ReleaseFun = UI_Calendar_Create_Test;

    ListDesc.List.ButtonList[27].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[27].BtnTxt     = "Desktop Prompt";
    ListDesc.List.ButtonList[27].ReleaseFun = UI_Desktop_Prompt_Create_Test;

    ListDesc.List.ButtonList[28].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[28].BtnTxt     = "Time";
    ListDesc.List.ButtonList[28].ReleaseFun = UI_Normal_Time_Create_Test;

    ListDesc.List.ButtonList[29].TxtId      = LV_LANG_TXT_ID_NONE;
    ListDesc.List.ButtonList[29].BtnTxt     = "Dial";
    ListDesc.List.ButtonList[29].ReleaseFun = UI_DialPad_Create_Test;

    ListDesc.BtnBar.ButtonL.Valid = FALSE;
    ListDesc.BtnBar.ButtonM.Valid = TRUE;
    ListDesc.BtnBar.ButtonR.Valid = FALSE;

    ListDesc.BtnBar.ButtonM.TxtId = PHONE_TEXT_ID_SELECT;
    ListDesc.KeyFunc              = UI_Normal_Test_KeyFunc;

    UI_Normal_List_Only_Create(&ListDesc);
    lv_label_set_text(ListDesc.TitleBar.Label, "UI Common Test");

    free(ListDesc.List.ButtonList);
} /* UI_Normal_List_Only_Create_Test */

#if (defined USE_LV_INTERPHONE_DEMO) || (USE_LV_DEMO_128x64 == 0)
static VOID btn_click_action(lv_obj_t *btn_act)
{
    last_key_state = LV_INDEV_STATE_REL;
}


static VOID btn_press_action(lv_obj_t *btn_act)
{
    last_key_state = LV_INDEV_STATE_PR;
    last_key       = UI_Get_User_Num(btn_act);
}

static VOID btn_action(lv_obj_t *btn_act, lv_event_t Event)
{
    if (LV_EVENT_PRESSED == Event)
    {
        btn_press_action(btn_act);
    }
    else if (LV_EVENT_CLICKED == Event)
    {
        btn_click_action(btn_act);
    }
}
#endif

#ifdef USE_LV_INTERPHONE_DEMO


static VOID UI_Normal_Draw_WTalkieBg()
{
    LV_IMG_DECLARE(radiobg);
    PhoneBg = lv_img_create(lv_scr_act(), NULL);

    lv_img_set_src(PhoneBg, &radiobg);
    lv_obj_add_protect(PhoneBg, LV_PROTECT_POS);

    ScrCont = lv_cont_create(PhoneBg, NULL);

    lv_obj_set_size(ScrCont, FP_HOR_RES, FP_VER_RES);
    lv_obj_set_pos(ScrCont, 19, 192);
}


static VOID UI_Common_Draw_WTalkieBtn()
{
    lv_obj_t *Button[9];
    UINT8    i = 0;

    for (i = 0; i < 9; i++)
    {
        Button[i] = lv_btn_create(PhoneBg, NULL);

        if (i < 6)
        {
            lv_obj_set_size(Button[i], 35, 25);
        }
        else
        {
            lv_obj_set_size(Button[i], 18, 40);
        }

        lv_obj_add_style(Button[i], LV_BTN_PART_MAIN, &lv_style_transp_tight);

        lv_obj_set_event_cb(Button[i],btn_action);
    }

    lv_obj_set_pos(Button[0],35,340);  // ok
    UI_Set_User_Num(Button[0], KEY_OK);

    lv_obj_set_pos(Button[1],130,345); // sr
    UI_Set_User_Num(Button[1], KEY_SOFTRIGHT);

    lv_obj_set_pos(Button[2],35,380);  // dial
    UI_Set_User_Num(Button[2], KEY_DIAL);

    lv_obj_set_pos(Button[3],125,380); // end
    UI_Set_User_Num(Button[3], KEY_END);

    lv_obj_set_pos(Button[4],85,345); // up
    UI_Set_User_Num(Button[4], KEY_UP);

    lv_obj_set_pos(Button[5],85,380); // down
    UI_Set_User_Num(Button[5], KEY_DOWN);

    lv_obj_set_pos(Button[6],0, 160);     // sl  push to talk
    UI_Set_User_Num(Button[6], KEY_SOFTLEFT);

    lv_obj_set_pos(Button[7],0, 220);     // right  volume +
    UI_Set_User_Num(Button[7], KEY_RIGHT);

    lv_obj_set_pos(Button[8],0, 280);     // left  volume -
    UI_Set_User_Num(Button[8], KEY_LEFT);
} /* UI_Common_Draw_PhoneBtn */

#elif USE_LV_DEMO_128x64

static VOID UI_Normal_Draw_DemoBg()
{
    (void)PhoneBg;
    ScrCont = lv_cont_create(lv_scr_act(), NULL);

    lv_obj_set_size(ScrCont, FP_HOR_RES, FP_VER_RES);
    lv_obj_set_pos(ScrCont, 0, 0);
}

#else


static VOID call_btn_click_action(lv_obj_t *btn_call, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }

    MMI_MODEM_SIM_ID               SimId = MMI_MODEM_SIM_1;
    INT32                          Index = 1;
    MMI_Modem_Call_Response_Clip_t *Clip = NULL;

    // ring
    Phone_Modem_Call_Response_Ring(SimId, Index);

    // clip
    Clip =
        (MMI_Modem_Call_Response_Clip_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Call_Response_Clip_t));
    Clip->type   = 0;
    Clip->number = (INT8 *)Hal_Mem_Alloc(strlen("123") + 1);
    Hal_Mem_Set(Clip->number, 0, strlen("123") + 1);
    Hal_Mem_Copy(Clip->number, "123", strlen("123"));
    Phone_Modem_Call_Response_Clip(SimId, Index, Clip);
}


static VOID sms_btn_click_action(lv_obj_t *btn_sms, lv_event_t Event)
{
    if (LV_EVENT_CLICKED != Event)
    {
        return;
    }

//    MMI_Modem_Report_New_Sms_Ind_t *pRepNewSms = NULL;

    printf("coming sms!\n");

    /* pRepNewSms = */
    /*     (MMI_Modem_Report_New_Sms_Ind_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Report_New_Sms_Ind_t)); */
    /* Hal_Mem_Set(pRepNewSms,0,sizeof(MMI_Modem_Report_New_Sms_Ind_t)); */
    /* pRepNewSms->MsgContentInfo.MsgIndex    = 5; */
    /* pRepNewSms->MsgContentInfo.ReadSmsType = MMI_MODEM_UNREAD; */
    /* pRepNewSms->MsgContentInfo.SimId       = MMI_MODEM_SIM_1; */

    /* Phone_Modem_Rep_New_Sms_Ind(pRepNewSms); */

    app_adp_new_sms_info_ind_t *pNewSms = (app_adp_new_sms_info_ind_t *)Hal_Mem_Alloc(sizeof(app_adp_new_sms_info_ind_t));
    hal_rtc_t tm;
    char time[20] = {};

    memset(&time, 0, 20);
    Hal_Rtc_Gettime(&tm);
    snprintf(time, 20, "%.4d-%.2d-%.2d %.2d:%.2d", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min);

    pNewSms->simid = APP_SIM_1;
    pNewSms->number = "13444448888";
    pNewSms->number_len = 11;
    pNewSms->time = lv_mem_alloc(strlen(time));
    memcpy(pNewSms->time, time, strlen(time));
    pNewSms->time_len = strlen(time);
    pNewSms->data = "hello";
    pNewSms->data_len = 5;
    MMI_Modem_Sms_File_New_Sms_Ind(pNewSms);
}


static VOID UI_Normal_Draw_PhoneBg()
{
    PhoneBg = lv_img_create(lv_scr_act(), NULL);

    lv_img_set_src(PhoneBg, &phonebg);
    lv_obj_add_protect(PhoneBg, LV_PROTECT_POS);

    ScrCont = lv_cont_create(PhoneBg, NULL);

    lv_obj_set_size(ScrCont, FP_HOR_RES, FP_VER_RES);
    lv_obj_set_pos(ScrCont, 36, 54);
}


static VOID UI_Common_Draw_PhoneBtn()
{
    lv_obj_t *Button[23];
    UINT8    i = 0;

    for (i = 0; i < 23; i++)
    {
        Button[i] = lv_btn_create(PhoneBg, NULL);
        if (i == 19 || i == 20)
        {
            lv_obj_set_size(Button[i], 30, 67);
        }
        else
        {
            lv_obj_set_size(Button[i], 78, 40);
        }
        if (i < 10)
        {
            UI_Set_User_Num(Button[i], i + 48);
        }

        lv_obj_add_style(Button[i], LV_BTN_PART_MAIN, &lv_style_transp_tight);

        if (i == 21)
        {
            lv_obj_set_event_cb(Button[i], call_btn_click_action);
        }
        else if (i == 22)
        {
            lv_obj_set_event_cb(Button[i], sms_btn_click_action);
        }
        else
        {
            lv_obj_set_event_cb(Button[i],btn_action);
        }
    }

    lv_obj_set_pos(Button[0],113,655);  // 0
    lv_obj_set_pos(Button[1],27,517);   // 1
    lv_obj_set_pos(Button[2],113,517);  // 2
    lv_obj_set_pos(Button[3],215,517);  // 3
    lv_obj_set_pos(Button[4],27,562);   // 4
    lv_obj_set_pos(Button[5],113,562);  // 5
    lv_obj_set_pos(Button[6],215,562);  // 6
    lv_obj_set_pos(Button[7],27,611);   // 7
    lv_obj_set_pos(Button[8],113,611);  // 8
    lv_obj_set_pos(Button[9],215,611);  // 9

    lv_obj_set_pos(Button[10],27,655);  // *
    UI_Set_User_Num(Button[10], KEY_ASTERISK);

    lv_obj_set_pos(Button[11],215,655); // #
    UI_Set_User_Num(Button[11], KEY_HASH);

    lv_obj_set_pos(Button[12],133,437); // ok
    UI_Set_User_Num(Button[12], KEY_OK);

    lv_obj_set_pos(Button[13],27,417);  // sl
    UI_Set_User_Num(Button[13], KEY_SOFTLEFT);

    lv_obj_set_pos(Button[14],215,417); // sr
    UI_Set_User_Num(Button[14], KEY_SOFTRIGHT);

    lv_obj_set_pos(Button[15],27,472);  // dial
    UI_Set_User_Num(Button[15], KEY_DIAL);

    lv_obj_set_pos(Button[16],215,472); // end
    UI_Set_User_Num(Button[16], KEY_END);

    lv_obj_set_pos(Button[17],120,397); // up
    UI_Set_User_Num(Button[17], KEY_UP);

    lv_obj_set_pos(Button[18],120,477); // down
    UI_Set_User_Num(Button[18], KEY_DOWN);

    lv_obj_set_pos(Button[19],95,423);  // left
    UI_Set_User_Num(Button[19], KEY_LEFT);

    lv_obj_set_pos(Button[20],188,423); // right
    UI_Set_User_Num(Button[20], KEY_RIGHT);

    lv_obj_set_pos(Button[21],40,10); // coming call
    UI_Set_User_Num(Button[21], 21);

    lv_obj_set_pos(Button[22],210,10); // coming sms
    UI_Set_User_Num(Button[22], 22);
} /* UI_Common_Draw_PhoneBtn */

#endif


/**********************
*   GLOBAL FUNCTIONS
**********************/
lv_obj_t *UI_Common_Test_Scr()
{
    return(ScrCont);
}


bool UI_Common_Test_Keyboard_Read(lv_indev_drv_t * indev_drv, lv_indev_data_t *data)
{
    (void) indev_drv;      /*Unused*/

    data->state = last_key_state;
    data->key   = last_key;

    return(FALSE);
}


VOID UI_Common_Test_Main()
{
    UI_Normal_Common_init();
#ifdef USE_LV_INTERPHONE_DEMO
    UI_Normal_Draw_WTalkieBg();
    UI_Common_Draw_WTalkieBtn();
#elif USE_LV_DEMO_128x64
    UI_Normal_Draw_DemoBg();
#else
    UI_Normal_Draw_PhoneBg();
    UI_Common_Draw_PhoneBtn();
#endif

    // UI_Status_Bar_Create_Test(NULL, LV_EVENT_CLICKED);
    // UI_Normal_List_Only_Create_Test(NULL, LV_EVENT_CLICKED);
}     /* UI_Common_Test_Main */
